<template>
  	<div class="wrap">
	  	<div class="login-box">
            <el-input
                class="input"
                placeholder="用户名"
                v-model="id"
                clearable>
                <span slot="prefix"><i class="input-icon iconfont icon-icon"></i></span>
            </el-input>
            <el-input
                class="input"
                type="password"
                placeholder="密码"
                v-model="pwd"
                @keyup.enter.native="login"
                clearable>
                <span slot="prefix"><i class="input-icon iconfont icon-mima"></i></span>
            </el-input>
            <p><el-checkbox label="记住我" @keyup.enter.native="login" v-model="rememberMe" name="type"></el-checkbox></p>
            <el-button @click="login" type="primary" class="submit">登录</el-button>
        </div>
  	</div>
</template>

<script>
    export default {
        data(){
			return {
                id: '',
                pwd: '',
                rememberMe: false,
			}
		},
		methods: {
            login(){
                let params = {
                    id: this.id,
                    pwd: this.pwd,
                    rememberMe: this.rememberMe
                }
                this.startLoading()
                this.$post("/anapi/LoginController/login", params, (data) => {
                    this.$router.replace('./index')
                })
            },
        }
    }
</script>
<style lang="less" scoped>
    .wrap{
        padding-top: 0;
        background-size: cover;
        background-repeat: no-repeat;
        background-position: center;
        background-image: url(../assets/1.jpg)
    }
    .login-box{
        width: 400px;
        background: #fff;
        height: 260px;
        position: absolute;
        top: 50%;
        left: 50%;
        margin-top: -200px;
        margin-left: -200px;
        padding: 30px 40px;
        box-sizing: border-box;
        .input{
            margin-bottom: 20px;
            .input-icon{
                font-size: 20px;
                line-height: 40px;
            }
        }
        .submit{
            width: 100%;
            margin-top: 18px;
        }
    }
</style>



